//
//  StandardLabel.swift
//  CooperSwift_Example
//
//  Created by 计海峰 on 2021/6/4.
//  Copyright © 2021 CocoaPods. All rights reserved.
//

import Foundation
import UIKit

public extension UILabel {
   
    // 标题
    func standListTitleConfig(_ title: String = "", widthConstraint widthCons:Bool = false) {
        text = title
        isHidden = false
        textColor = .black
        font = .systemFont(ofSize: 15)
        if widthCons {
            self.snp.makeConstraints {
                $0.width.equalTo(title.getStringWidth(font)+1)
            }
        }
    }
    
    // 内容
    func standListInfoConfig(_ title: String = "", widthConstraint widthCons:Bool = false) {
        text = title
        isHidden = false
        textColor = .darkGray
        font = .systemFont(ofSize: 14)
        if widthCons {
            self.snp.makeConstraints {
                $0.width.equalTo(title.getStringWidth(font)+1)
            }
        }
    }
    
}
